package com.chen.controller;

import com.chen.pojo.dto.ChannelDto;
import com.chen.pojo.vo.ChannelVo;
import com.chen.service.ChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author chen
 * @version 1.0
 * @create_date 2025/8/22
 * 售货机货道管理
 */
@RestController
@RequestMapping("/api/vm-service/channel")
public class ChannelController {
    @Autowired
    private ChannelService channelService;

    // 获取售货机货道详情
    @GetMapping("channelList/{innerCode}")
    public List<ChannelVo> getChannelList(@PathVariable String innerCode) {
        return channelService.getChannelList(innerCode);
    }

    // 货道配置
    @PutMapping("/channelConfig")
    public Boolean channelConfig(@RequestBody ChannelDto channelDto) {
        return channelService.channelConfig(channelDto);
    }
}
